﻿@{      
    string flagMaskStr = Request.QueryParam("flagMask");
    var flagMask = new Dictionary<String, Boolean>
    {
        {"Voided", false},
        {"Refunded", false},
        {"Pending", true},
        {"Authorized", true},
        {"Captured", true}
    };
    if(!String.IsNullOrWhiteSpace(flagMaskStr))
    {
        var tmp = flagMask.Keys.ToList();
        foreach(var i in tmp)
        {
            flagMask[i] = flagMaskStr.Contains(i);
        }
    }
}

<nav>
@foreach(var kv in flagMask)
{
    var tmp = flagMask.Where(x => x.Value).Select(x => x.Key);
    <span class="separator">[</span>
    <a href="@Url.Action(Loc.Act("Index").Set(new
    {
        flagMask = (kv.Value ? tmp.Except(new []
        {
            kv.Key
        }) : tmp.Union(new []
        {
            kv.Key
        })).Merge(",")
    }).Localized())" class="@(kv.Value ? String.Empty : "inactive")">@T(Res.Name(kv.Key))</a>
    <span class="separator">]</span>
}
</nav>   